const layoutHeader = new Vue({
    el: '#header',
    data: function () {
        return {
            currentUser: {},
            menuArray: [{
                label: '首页',
            }],
            bus: bus,
        }
    },
    methods: {
        // 侧边栏折叠
        collapseChange() {
            this.bus.collapse = !this.bus.collapse;
        },
        async logout() {
            if (await ajaxOption({
                res: sysLoginApi.logout(),
                danger: '注销失败',
                success: '注销成功，即将跳转到登录页',
            })) {
                location.href = '/system/login'
            }
        },
        editSysUser() {
            forward('/system-config/modify/admin_privilege_admin_edit', this.currentUser)
        },
    },
    async mounted() {
        this.currentUser = await sysLoginApi.currentUser();
    }
})